AWSTemplateFormatVersion: 2010-09-09

Parameters:

  resourcePrefix:
    Type: String

Resources:

{% for role in roleNames %}
  Role{{ role }}:
    Type: "AWS::IAM::Role"
    Properties:
      RoleName: !Sub '${resourcePrefix}-{{ role }}'
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
          - Sid: AssumeRole1
            Effect: Allow
            Principal:
              Service: cloudtrail.amazonaws.com
            Action: sts:AssumeRole
{% endfor %}
